package com.gzl.b2b.demo.service.impl;

import com.gzl.b2b.demo.common.annotation.WatchMethodTime;
import com.gzl.b2b.demo.dao.DemoRepository;
import com.gzl.b2b.demo.entity.Demo;
import com.gzl.b2b.demo.service.DemoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.PageRequest;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @version 1.0, 2019/4/22
 */
@Service
public class DemoServiceImpl implements DemoService {

    @Autowired
    private DemoRepository demoRepository;


    @Override
    @WatchMethodTime
    public List<Demo> findByNameIsLike(String name) {
        return demoRepository.findByNameIsLike(name, PageRequest.of(0, 1000));
    }
}
